package com.zenithmind.library.pojo.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.zenithmind.common.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 图书分类实体
 * 
 * @author ZenithMind
 * @since 2024-06-14
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(name = "图书分类实体", description = "图书分类信息")
@TableName("lib_category")
public class Category extends BaseEntity {

    @NotBlank(message = "分类名称不能为空")
    @Size(max = 100, message = "分类名称长度不能超过100个字符")
    @Schema(description = "分类名称")
    private String name;

    @NotBlank(message = "分类编码不能为空")
    @Size(max = 50, message = "分类编码长度不能超过50个字符")
    @Schema(description = "分类编码")
    private String code;

    @Schema(description = "父分类ID")
    private String parentId;

    @Schema(description = "分类描述")
    @Size(max = 500, message = "分类描述长度不能超过500个字符")
    private String description;

    @Schema(description = "排序号")
    private Integer sortOrder;

    @Schema(description = "分类图标")
    private String icon;

    @Schema(description = "分类颜色")
    private String color;

    @Schema(description = "状态 (0-禁用, 1-启用)")
    private Integer status;

    @Schema(description = "是否叶子节点 (0-否, 1-是)")
    private Integer isLeaf;

    @Schema(description = "层级深度")
    private Integer level;

    @Schema(description = "分类路径")
    private String path;
}
